#ifndef FAKE_ROOT_H
#define FAKE_ROOT_H

#include <chrono>
#include <unordered_map>
#include <mutex>
#include <set>
#include <string>
#include <vector>

#include "api/gfs.h"

#define ALIAS_REAL "*"
#define ALIAS_FAKE "?"
#define ALIAS_CUR "."
#define ALIAS_PREV ".."

struct ShareContent {
    std::unordered_map<std::string, std::string> fileMap;
    uint64_t lastAccessTime;
    bool fake{};
    bool hidden{};
    bool readOnly{};
};

typedef std::unordered_map<std::string, ShareContent> PathMapper;

namespace FakeRoot {
bool TranslatePath(const PathMapper& lockedPathMapper, const char* hostPath,
                   std::string& shareName, std::string& fullPath, bool& root,
                   bool& fake);
int Open(GuestFuseSrvRPL* rpl);
int GetAttr(GuestFuseSrvRPL* rpl);
int ReadDir(const std::vector<std::pair<const std::string&, bool>>& contentList,
            GuestFuseSrvRPL* rpl, int rplBuffSz);
}  // namespace FakeRoot

#endif // FAKE_ROOT_H
